package com.toutoushidao.ssm.web;

import com.toutoushidao.ssm.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Locale;

/**
 * Created by ThinkPad on 2016/11/1.
 */
@Controller
public abstract class LocaleSupport extends BaseService {
    @Autowired
    private MessageSource messageSource;

    public String getMessage(String code, String ... placeholders) {
        return messageSource.getMessage(code, placeholders, "", Locale.CHINA);
    }
}
